package com.ssy.lingxi.report.api.enums;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 *  竞价操作类型枚举
 * @author ds
 * @date 2021/5/11
 * @version 2.0.0
 */
public enum PurchaseBiddingOperateTypeEnum {
    TO_BE_COMMIT_VALIFY_COUNT(1,"待提交审核采购竞价单",""),
    TO_BE_VALIFY_STEP1_COUNT(2,"待审核采购竞价单（一级）",""),
    TO_BE_VALIFY_STEP2_COUNT(3,"待审核采购竞价单（二级）",""),
    TO_BE_COMMIT_COUNT(4,"待提交采购竞价单",""),
    TO_BE_VALIFY_COUNT(5,"待审核竞价报名",""),
    TO_BE_BIDDING_COUNT(6,"待竞价",""),
    TO_BE_COMMIT_VALIFY_RESULT_COUNT(7,"待提交审核竞价结果",""),
    TO_BE_VALIFY_RESULT_STEP1_COUNT(8,"待审核竞价结果（一级）",""),
    TO_BE_VALIFY_RESULT_STEP2_COUNT(9,"待审核竞价结果（二级）",""),
    TO_BE_CONFIRM_RESULT_COUNT(10,"待确认竞价结果",""),
    ;
    /**
     * 编码
     */
    private final Integer code;
    /**
     * 名称
     */
    private final String name;
    /**
     * 链接
     */
    private final String link;


    PurchaseBiddingOperateTypeEnum(Integer code, String name, String link) {
        this.code = code;
        this.name = name;
        this.link = link;
    }

    public static PurchaseBiddingOperateTypeEnum getEnum(Integer code) {
        return Arrays.stream(PurchaseBiddingOperateTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }


    public Integer getCode() {
        return code;
    }

    public String getName() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }

    public String getLink() {
        return link;
    }
}
